package com.sixth.controller;

import com.sixth.service.InventoryService;
import com.sixth.util.CommonResult;
import com.sixth.util.LayTab;
import com.sixth.util.TableLayUi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: project01
 * @description:
 * @author: 高振杨
 * @create: 2021-12-21 11:39
 **/
@RestController
@RequestMapping("/inventory")
public class InventoryController {
    @Autowired
    private InventoryService service;

    //获取所有审核信息
    @RequestMapping("/getAllInventory")
    public TableLayUi getAllInventory(int page, int limit,Integer branchid){
        return service.getAllInventory(page, limit,branchid);
    }

    //获取盘点审核商品
    @RequestMapping("/getInventoryGoods")
    public TableLayUi getInventoryGoods(int page, int limit,Integer invenid) {
        return service.getInventoryGoods(page,limit,invenid);
    }

    //盘点审核通过
    @RequestMapping("/inventoryExPass")
    public CommonResult inventoryExPass(Integer invenid, Integer branchid) {
        return service.inventoryExPass(invenid,branchid);
    }

    //驳回
    @RequestMapping("/inventoryExReject")
    public CommonResult inventoryExReject( Integer invenid,Integer branchid,String remarks) {
        return service.inventoryExReject(invenid,branchid,remarks);
    }


    //查询是否有盘点
    @RequestMapping("/selectPanDian")
    public CommonResult addPanDian(Integer branchid) {
        CommonResult result = service.selectPanDian(branchid);
        return result;
    }

    //添加盘点
    @RequestMapping("/addpanDian")
    public CommonResult panDian(String panDianGoods) {
        return service.addpanDian(panDianGoods);
    }

    //报损信息
    @RequestMapping("/getAllFrmLoss")
    public TableLayUi getAllFrmLoss(int page,int limit,Integer branchid,String time) {
        return service.getAllFrmLoss(page, limit, branchid, time);
    }


}
